package com.caxxb.controller;

import com.caxxb.entity.Game;
import com.caxxb.service.GameService;
import com.caxxb.service.impl.GameServiceImpl;
import com.caxxb.util.PageData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
public class TestController {

    private GameService gameService=new GameServiceImpl();

    @GetMapping("/hello")
    public String sayHello(){
        return "hello";
    }


  /*  @GetMapping("test")
    public QR page(@RequestParam(value = "keywords",defaultValue ="",required = false )String keywords, @RequestParam(value = "pageNo",defaultValue ="1",required = false )int pageNo, @RequestParam(value = "pageSize",defaultValue ="10",required = false )int pageSize, HttpSession session){
        int gametypeid=1;
        if(session.getAttribute("typeid")!=null){
            gametypeid = (int) session.getAttribute("typeid");
        }

        System.out.println("typeid:"+gametypeid);
        PageData<Game> gamePages = gameService.getGamePages(gametypeid,keywords, pageNo, pageSize);
        return (QR) QR.success(gamePages);
//        return gamePages;
    }*/
}
